//
//  SearchResultTableViewCell.m
//  CPU_Utility
//
//  Created by leonardo on 15/10/13.
//  Copyright © 2015年 leonardo. All rights reserved.
//

#import "SearchResultTableViewCell.h"
#import <UIImageView+WebCache.h>
@interface SearchResultTableViewCell(){
    
    __weak IBOutlet UIImageView *imagePic;
    __weak IBOutlet UILabel *labelName;
    __weak IBOutlet UILabel *labelThisWeekHit;
    __weak IBOutlet UIImageView *imageUserCommStar;
    __weak IBOutlet UILabel *labelPrice;
}
@end

@implementation SearchResultTableViewCell

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)configWithModel:(SearchResultModelData *)model{
    self.tag = [model.id intValue];
    [imagePic sd_setImageWithURL:[NSURL URLWithString:model.smallPic] placeholderImage:[UIImage imageNamed:@"wawa"]];
    labelName.text = model.name;
    //[labelName sizeToFit];
    labelName.lineBreakMode = NSLineBreakByTruncatingTail;
    
    labelThisWeekHit.text = [NSString stringWithFormat:@"本周关注:%@",model.thisWeekHit];
    [labelName sizeToFit];
    labelPrice.text = [@[@"价格面议",@"即将上市",@"暂无报价",@"停产"] containsObject: ((NSString*)model.price) ]? (NSString*)model.price:[NSString stringWithFormat:@"￥%@",model.price];
    [labelPrice sizeToFit];
    
//#warning 用户评分
//    imageUserCommStar setImage:<#(UIImage * _Nullable)#>
    
    
}
@end
